<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta charset="utf-8"/>
    <title>用户登录</title>

    <meta name="description" content="User login page"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>

    <!-- bootstrap & fontawesome -->
    <link rel="stylesheet" href="{$static_path}/ace/css/bootstrap.css"/>
    <link rel="stylesheet" href="{$static_path}/font-awesome/css/font-awesome.css"/>

    <!-- text fonts -->
    <link rel="stylesheet" href="{$static_path}/ace/css/ace-fonts.css"/>

    <!-- ace styles -->
    <link rel="stylesheet" href="{$static_path}/ace/css/ace.css"/>

    <!--[if lte IE 9]>
    <link rel="stylesheet" href="{$static_path}/ace/css/ace-part2.css"/>
    <![endif]-->
    <link rel="stylesheet" href="{$static_path}/ace/css/ace-rtl.css"/>

    <!--[if lte IE 9]>
    <link rel="stylesheet" href="{$static_path}/ace/css/ace-ie.css"/>
    <![endif]-->

    <!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

    <!--[if lte IE 8]>
    <script src="{$static_path}/html5shiv/dist/html5shiv.min.js"></script>
    <script src="{$static_path}/respond/dest/respond.min.js"></script>
    <![endif]-->
</head>

<body class="login-layout blur-login">
<div class="main-container">
    <div class="main-content">
        <div class="row">
            <div class="col-sm-10 col-sm-offset-1">
                <div class="login-container">
                    <div class="center">
                        <h1>
                            <img src="{$static_path}/images/logo.png" style="height: 45px">
                            <span class="red">YFCMF</span>
                            <span class="blue" style="font-family:microsoft yahei" id="id-text2">网站后台管理</span>
                        </h1>
                    </div>

                    <div class="space-6"></div>

                    <div class="position-relative">
                        <div id="login-box" class="login-box visible widget-box no-border">
                            <div class="widget-body">
                                <div class="widget-main">
                                    <h4 class="header blue lighter bigger text-center">
                                        <i class="ace-icon fa fa-coffee green"></i>
                                        后台登录
                                    </h4>

                                    <div class="space-6"></div>
                                    <form class="ajaxForm" name="login" method="post" action="{:url('login')}">
                                        <fieldset>
                                            <label class="block clearfix">
                                                <span class="block input-icon input-icon-right">
                                                    <input type="text" class="form-control" name="username" placeholder="用户名" required/>
                                                    <i class="ace-icon fa fa-user"></i>
                                                </span>
                                            </label>

                                            <label class="block clearfix">
                                                <span class="block input-icon input-icon-right">
                                                    <input type="password" class="form-control" name="password" placeholder="输入密码" required/>
                                                    <i class="ace-icon fa fa-lock"></i>
                                                </span>
                                            </label>
                                            {if condition="config('yfcmf.geetest.geetest_on')"}
                                            <div id="captcha"></div>
                                            <div class="space-6"></div>
                                            {else /}
                                            <label class="block clearfix">
                                                <span class="block input-icon input-icon-right">
                                                    <input type="text" class="form-control" name="verify" id="verify" placeholder="输入验证码" required/>
                                                    <i class="ace-icon fa fa-sort-alpha-asc"></i>
                                                </span>
                                            </label>
                                            <label class="block clearfix">
                                                <span class="block text-center">
                                                    <img class="verify_img" id="verify_img" src="{:url('verify')}" onClick="this.src='{:url('verify')}'+'?'+Math.random()" style="cursor: pointer;width:100%;border: 1px solid #d5d5d5;" title="点击获取">
                                                </span>
                                            </label>
                                            {/if}

                                            <div class="clearfix">
                                                <label class="inline">
                                                    <input name="rememberme" type="checkbox" class="ace"/>
                                                    <span class="lbl"> 记住信息</span>
                                                </label>

                                                <button type="submit" class="width-35 pull-right btn btn-sm btn-primary">
                                                    <i class="ace-icon fa fa-key"></i>
                                                    <span class="bigger-110">登录</span>
                                                </button>
                                            </div>

                                            <div class="space-4"></div>
                                        </fieldset>
                                    </form>
                                </div><!-- /.widget-main -->
                            </div><!-- /.widget-body -->
                        </div><!-- /.login-box -->
                    </div><!-- /.position-relative -->

                </div>
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.main-content -->
</div><!-- /.main-container -->

<!-- basic scripts -->

<!--[if !IE]> -->
<script src="{$static_path}/jquery/dist/jquery.js"></script>

<!-- <![endif]-->

<!--[if IE]>
<script src="{$static_path}/jquery.1x/dist/jquery.js"></script>
<![endif]-->
<script type="text/javascript">
    if ('ontouchstart' in document.documentElement) document.write("<script src='{$static_path}/_mod/jquery.mobile.custom/jquery.mobile.custom.js'>" + "<" + "/script>");
</script>

<!-- inline scripts related to this page -->
<script src="{$static_path}/others/bootstrap.min.js"></script>
<script src="{$static_path}/others/jquery.form.js"></script>
<script src="{$static_path}/layer/layer_zh-cn.js"></script>
<script src="{$static_path}/others/maxlength.js"></script>
<script type="text/javascript">
    jQuery(function ($) {
        $(document).on('click', '.toolbar a[data-target]', function (e) {
            e.preventDefault();
            var target = $(this).data('target');
            $('.widget-box.visible').removeClass('visible');//hide others
            $(target).addClass('visible');//show target
        });
    });
    /* 通用含验证码表单不带检查操作，失败不跳转 */
    $(function () {
        $('.ajaxForm').ajaxForm({
            success: complete, // 这是提交后的方法
            dataType: 'json'
        });
    });
    //失败不跳转,验证码刷新
    function complete(data) {
        if (data.code == 1) {
            window.location.href = data.url;
        } else {
            $("#verify").val('');
            $("#verify_img").click();
            layer.alert(data.msg, {icon: 5});
        }
    }
</script>
</body>
</html>
